package part1.one;

import java.util.Arrays;

/**
 * @Author: shaochong
 * @Date: 2021/8/5
 * @Description:
 */
public class Solution {
    public static int[] twoSum(int[] nums, int target) {
        int len = nums.length;
        int[] answer = new int[2];
        for(int i = 0; i < len; i++) {
            for (int j = i + 1; j < len; j++) {
                if (nums[i] + nums[j] == target) {
                    answer[0] = i;
                    answer[1] = j;
                }
            }
        }
        return answer;
    }


    public static void main(String[] args) {
        int[] arr = new int[4];
        arr[0] = -3;
        arr[1] = 4;
        arr[2] = 3;
        arr[3] = 90;
        int target = 0;
        System.out.println(Arrays.toString(twoSum(arr, target)));
    }


}
